#pragma once

#include <QMainWindow>
#include <QMessageBox>
#include <QFileDialog>
#include <QFile>
#include <QThread>
#include <winsock2.h>
#include <QtConcurrent>
#include <QtNetwork>
#include <RecieveThread.h>
#include <SaveThread.h>

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void on_portSwitch_clicked();

    void on_pathSelectBtn_clicked();
    void moduleControl(bool control);

private:
    Ui::MainWindow *ui;

    //用户定义
    QString localIP;
    QThread *recieveWorkThread{nullptr};
    QThread *saveWorkThread{nullptr};

    std::queue<char> dataQueue;
    RecieveThread *recieveHandle{nullptr};
    SaveThread *saveHandle{nullptr};
};
